<?php
/**
 * 后台登陆
 */
namespace app\admin\controller;
use think\Controller;
use think\Loader;
use think\Request;
use think\Db;
class Console extends Controller
{
    // 登陆
    public function console(){
    $list['adminCount'] = DB::name('admin')->count();
    $list['categoryCount'] = DB::name('category')->count();
    $list['shopCount'] = DB::name('shop')->count();
    $this->assign('list', $list);
    return $this->fetch();
    }

    // 退出登录
    public function loginout(){
        $admin = Loader::model('admin');
        $out = $admin->loginout();
        if($out  == "1"){
            $this->error("退出失败");
        }else{
            $this->redirect('admin/login/login');
        }
    }
}